Optimal. Leaf size=429 \[ -\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (1+a x) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\log (1+a x) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\text {PolyLog}\left (2,-\frac {\sqrt {d} (1-a x)}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\text {PolyLog}\left (2,\frac {\sqrt {d} (1-a x)}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\text {PolyLog}\left (2,-\frac {\sqrt {d} (1+a x)}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\text {PolyLog}\left (2,\frac {\sqrt {d} (1+a x)}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.32, antiderivative size = 429, normalized size of antiderivative = 1.00, number of steps
used = 17, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {6119, 2456,
2441, 2440, 2438} \begin {gather*} -\frac {\text {Li}_2\left (-\frac {\sqrt {d} (1-a x)}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\text {Li}_2\left (\frac {\sqrt {d} (1-a x)}{\sqrt {-c} a+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\text {Li}_2\left (-\frac {\sqrt {d} (a x+1)}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\text {Li}_2\left (\frac {\sqrt {d} (a x+1)}{\sqrt {-c} a+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (a x+1) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\log (a x+1) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2438
Rule 2440
Rule 2441
Rule 2456
Rule 6119
Rubi steps
\begin {align*} \int \frac {\tanh ^{-1}(a x)}{c+d x^2} \, dx &=-\left (\frac {1}{2} \int \frac {\log (1-a x)}{c+d x^2} \, dx\right )+\frac {1}{2} \int \frac {\log (1+a x)}{c+d x^2} \, dx\\ &=-\left (\frac {1}{2} \int \left (\frac {\sqrt {-c} \log (1-a x)}{2 c \left (\sqrt {-c}-\sqrt {d} x\right )}+\frac {\sqrt {-c} \log (1-a x)}{2 c \left (\sqrt {-c}+\sqrt {d} x\right )}\right ) \, dx\right )+\frac {1}{2} \int \left (\frac {\sqrt {-c} \log (1+a x)}{2 c \left (\sqrt {-c}-\sqrt {d} x\right )}+\frac {\sqrt {-c} \log (1+a x)}{2 c \left (\sqrt {-c}+\sqrt {d} x\right )}\right ) \, dx\\ &=\frac {\int \frac {\log (1-a x)}{\sqrt {-c}-\sqrt {d} x} \, dx}{4 \sqrt {-c}}+\frac {\int \frac {\log (1-a x)}{\sqrt {-c}+\sqrt {d} x} \, dx}{4 \sqrt {-c}}-\frac {\int \frac {\log (1+a x)}{\sqrt {-c}-\sqrt {d} x} \, dx}{4 \sqrt {-c}}-\frac {\int \frac {\log (1+a x)}{\sqrt {-c}+\sqrt {d} x} \, dx}{4 \sqrt {-c}}\\ &=-\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (1+a x) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\log (1+a x) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {a \int \frac {\log \left (-\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{-a \sqrt {-c}+\sqrt {d}}\right )}{1-a x} \, dx}{4 \sqrt {-c} \sqrt {d}}-\frac {a \int \frac {\log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{1+a x} \, dx}{4 \sqrt {-c} \sqrt {d}}+\frac {a \int \frac {\log \left (-\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{-a \sqrt {-c}-\sqrt {d}}\right )}{1-a x} \, dx}{4 \sqrt {-c} \sqrt {d}}+\frac {a \int \frac {\log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{1+a x} \, dx}{4 \sqrt {-c} \sqrt {d}}\\ &=-\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (1+a x) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\log (1+a x) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\text {Subst}\left (\int \frac {\log \left (1+\frac {\sqrt {d} x}{-a \sqrt {-c}-\sqrt {d}}\right )}{x} \, dx,x,1-a x\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\text {Subst}\left (\int \frac {\log \left (1+\frac {\sqrt {d} x}{a \sqrt {-c}-\sqrt {d}}\right )}{x} \, dx,x,1+a x\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\text {Subst}\left (\int \frac {\log \left (1-\frac {\sqrt {d} x}{-a \sqrt {-c}+\sqrt {d}}\right )}{x} \, dx,x,1-a x\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\text {Subst}\left (\int \frac {\log \left (1-\frac {\sqrt {d} x}{a \sqrt {-c}+\sqrt {d}}\right )}{x} \, dx,x,1+a x\right )}{4 \sqrt {-c} \sqrt {d}}\\ &=-\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (1+a x) \log \left (\frac {a \left (\sqrt {-c}-\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\log (1+a x) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\log (1-a x) \log \left (\frac {a \left (\sqrt {-c}+\sqrt {d} x\right )}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\text {Li}_2\left (-\frac {\sqrt {d} (1-a x)}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\text {Li}_2\left (\frac {\sqrt {d} (1-a x)}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}-\frac {\text {Li}_2\left (-\frac {\sqrt {d} (1+a x)}{a \sqrt {-c}-\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}+\frac {\text {Li}_2\left (\frac {\sqrt {d} (1+a x)}{a \sqrt {-c}+\sqrt {d}}\right )}{4 \sqrt {-c} \sqrt {d}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.96, size = 662, normalized size = 1.54 \begin {gather*} -\frac {a \left (-2 i \text {ArcCos}\left (\frac {-a^2 c+d}{a^2 c+d}\right ) \text {ArcTan}\left (\frac {a d x}{\sqrt {a^2 c d}}\right )+4 \text {ArcTan}\left (\frac {a c}{\sqrt {a^2 c d} x}\right ) \tanh ^{-1}(a x)-\left (\text {ArcCos}\left (\frac {-a^2 c+d}{a^2 c+d}\right )+2 \text {ArcTan}\left (\frac {a d x}{\sqrt {a^2 c d}}\right )\right ) \log \left (\frac {2 i a c \left (i d+\sqrt {a^2 c d}\right ) (-1+a x)}{\left (a^2 c+d\right ) \left (a c+i \sqrt {a^2 c d} x\right )}\right )-\left (\text {ArcCos}\left (\frac {-a^2 c+d}{a^2 c+d}\right )-2 \text {ArcTan}\left (\frac {a d x}{\sqrt {a^2 c d}}\right )\right ) \log \left (\frac {2 a c \left (d+i \sqrt {a^2 c d}\right ) (1+a x)}{\left (a^2 c+d\right ) \left (a c+i \sqrt {a^2 c d} x\right )}\right )+\left (\text {ArcCos}\left (\frac {-a^2 c+d}{a^2 c+d}\right )+2 \left (\text {ArcTan}\left (\frac {a c}{\sqrt {a^2 c d} x}\right )+\text {ArcTan}\left (\frac {a d x}{\sqrt {a^2 c d}}\right )\right )\right ) \log \left (\frac {\sqrt {2} \sqrt {a^2 c d} e^{-\tanh ^{-1}(a x)}}{\sqrt {a^2 c+d} \sqrt {a^2 c-d+\left (a^2 c+d\right ) \cosh \left (2 \tanh ^{-1}(a x)\right )}}\right )+\left (\text {ArcCos}\left (\frac {-a^2 c+d}{a^2 c+d}\right )-2 \left (\text {ArcTan}\left (\frac {a c}{\sqrt {a^2 c d} x}\right )+\text {ArcTan}\left (\frac {a d x}{\sqrt {a^2 c d}}\right )\right )\right ) \log \left (\frac {\sqrt {2} \sqrt {a^2 c d} e^{\tanh ^{-1}(a x)}}{\sqrt {a^2 c+d} \sqrt {a^2 c-d+\left (a^2 c+d\right ) \cosh \left (2 \tanh ^{-1}(a x)\right )}}\right )+i \left (-\text {PolyLog}\left (2,\frac {\left (-a^2 c+d-2 i \sqrt {a^2 c d}\right ) \left (i a c+\sqrt {a^2 c d} x\right )}{\left (a^2 c+d\right ) \left (-i a c+\sqrt {a^2 c d} x\right )}\right )+\text {PolyLog}\left (2,\frac {\left (-a^2 c+d+2 i \sqrt {a^2 c d}\right ) \left (i a c+\sqrt {a^2 c d} x\right )}{\left (a^2 c+d\right ) \left (-i a c+\sqrt {a^2 c d} x\right )}\right )\right )\right )}{4 \sqrt {a^2 c d}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1001\) vs.
\(2(325)=650\).
time = 5.25, size = 1002, normalized size = 2.34 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] Result contains complex when optimal does not.
time = 0.54, size = 406, normalized size = 0.95 \begin {gather*} \frac {\arctan \left (\frac {d x}{\sqrt {c d}}\right ) \operatorname {artanh}\left (a x\right )}{\sqrt {c d}} + \frac {{\left (\arctan \left (\frac {{\left (a^{2} x + a\right )} \sqrt {c} \sqrt {d}}{a^{2} c + d}, \frac {a d x + d}{a^{2} c + d}\right ) - \arctan \left (\frac {{\left (a^{2} x - a\right )} \sqrt {c} \sqrt {d}}{a^{2} c + d}, -\frac {a d x - d}{a^{2} c + d}\right )\right )} \log \left (d x^{2} + c\right ) - \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right ) \log \left (\frac {a^{2} d x^{2} + 2 \, a d x + d}{a^{2} c + d}\right ) + \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right ) \log \left (\frac {a^{2} d x^{2} - 2 \, a d x + d}{a^{2} c + d}\right ) - i \, {\rm Li}_2\left (\frac {a^{2} c + a d x - {\left (i \, a^{2} x - i \, a\right )} \sqrt {c} \sqrt {d}}{a^{2} c + 2 i \, a \sqrt {c} \sqrt {d} - d}\right ) - i \, {\rm Li}_2\left (\frac {a^{2} c - a d x + {\left (i \, a^{2} x + i \, a\right )} \sqrt {c} \sqrt {d}}{a^{2} c + 2 i \, a \sqrt {c} \sqrt {d} - d}\right ) + i \, {\rm Li}_2\left (\frac {a^{2} c + a d x + {\left (i \, a^{2} x - i \, a\right )} \sqrt {c} \sqrt {d}}{a^{2} c - 2 i \, a \sqrt {c} \sqrt {d} - d}\right ) + i \, {\rm Li}_2\left (\frac {a^{2} c - a d x - {\left (i \, a^{2} x + i \, a\right )} \sqrt {c} \sqrt {d}}{a^{2} c - 2 i \, a \sqrt {c} \sqrt {d} - d}\right )}{4 \, \sqrt {c d}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {atanh}{\left (a x \right )}}{c + d x^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {\mathrm {atanh}\left (a\,x\right )}{d\,x^2+c} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________